package com.example.demo.service.impl;

import com.example.demo.bean.pmsBaseCatalog.PmsBaseCatalog1;
import com.example.demo.bean.pmsBaseCatalog.PmsBaseCatalog2;
import com.example.demo.bean.pmsBaseCatalog.PmsBaseCatalog3;
import com.example.demo.mapper.pmsBaseCatalogMapper.PmsBaseCatalog1Mapper;
import com.example.demo.mapper.pmsBaseCatalogMapper.PmsBaseCatalog2Mapper;
import com.example.demo.mapper.pmsBaseCatalogMapper.PmsBaseCatalog3Mapper;
import com.example.demo.service.PmsBaseCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PmsBaseCatalogServiceImpl implements PmsBaseCatalogService {
    @Autowired
    PmsBaseCatalog1Mapper pmsBaseCatalog1Mapper;
    @Autowired
    PmsBaseCatalog2Mapper pmsBaseCatalog2Mapper;
    @Autowired
    PmsBaseCatalog3Mapper pmsBaseCatalog3Mapper;
    @Override
    public List<PmsBaseCatalog1> getList() {
        return  pmsBaseCatalog1Mapper.selectAll();
    }

    @Override
    public int insertOne(PmsBaseCatalog1 pmsBaseCatalog1) {
        return 0;
    }

    @Override
    public int deleteOne(int id) {
        return 0;
    }

    @Override
    public int updataOne(PmsBaseCatalog1 pmsBaseCatalog1) {
        return 0;
    }
    @Override
    public List<PmsBaseCatalog2> getCatalog2(String catalog1Id){
        PmsBaseCatalog2 pmsBaseCatalog2 = new PmsBaseCatalog2();
        pmsBaseCatalog2.setCatalog1Id(catalog1Id);
        return pmsBaseCatalog2Mapper.select(pmsBaseCatalog2);
    }
    public List<PmsBaseCatalog3> getCataLog3(String catalog2Id){
        PmsBaseCatalog3 pmsBaseCatalog3 = new PmsBaseCatalog3();
        pmsBaseCatalog3.setCatalog2Id(catalog2Id);
        return pmsBaseCatalog3Mapper.select(pmsBaseCatalog3);
    }
}
